document.addEventListener('DOMContentLoaded', function() {
 var audio = document.getElementById('myAudio');
 var savedTime = localStorage.getItem('musicTime');

 if (savedTime) {
     audio.currentTime = parseFloat(savedTime);
     audio.play();
 }

 audio.addEventListener('timeupdate', function() {
     localStorage.setItem('musicTime', audio.currentTime);
 });
});
